﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VLUSM_DataAccess.Repositories
{
    public class DVHCCap1Repository : GenericRepository<DonViHanhChinhContainer, DVHCCap1>, IDisposable
    {
        public DVHCCap1 GetSingle(int id)
        {
            //var context = new DonViHanhChinhContainer();
            var query = Context.DVHCCap1.FirstOrDefault(x => x.Id == id);
            return query;
        }

        public IEnumerable<DVHCCap1> LayHet()
        {
            var result = SelectAll();
            return result;
        }

        /// <summary>
        /// Releases all resources used by the WarrantManagement.DataExtract.Dal.ReportDataBase
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Releases all resources used by the WarrantManagement.DataExtract.Dal.ReportDataBase
        /// </summary>
        /// <param name="disposing">A boolean value indicating whether or not to dispose managed resources</param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (Context != null)
                {
                    Context.Dispose();
                    Context = null;
                }
            }
        }
    }
}
